package yunjiao.designpatterns.interpreter.expr;

import yunjiao.designpatterns.interpreter.Employee;

/**
 * TODO
 *
 * @author yangyunjiao
 */
public class DesignationExpression extends TerminalExpression {
    protected String designation;

    public DesignationExpression(String designation) {
        this.designation = designation;
    }

    @Override
    public boolean interpret(Employee context) {
        return context.getDesignation().equalsIgnoreCase(designation);
    }

    @Override
    public String toString() {
        return "DesignationExpression [designation=" + designation + "]";

    }
}
